<template>
    <div class="wrap">
        <h3>请选择您将查看的企业</h3>
        <div class="h20"></div>
        <div v-for="(val,key) in companyList" :key="val.companyCode">
            <x-button type="primary" @click.native="nav(key)">{{val.companyName}}</x-button>
            <div class="h20"></div>
        </div>
    </div>
</template>

<script>
import Vue from 'vue'
import { Group, Cell, XInput, XButton, Loading, XDialog, Divider } from 'vux'
import { WechatPlugin, ToastPlugin } from 'vux'
import { AlertPlugin, ConfirmPlugin } from 'vux'

import axios from '@/api/axios'
import api from '@/api/base.api'
import { Grid, GridItem } from 'vux'
import { mapState } from 'vuex'
export default {
    components: {
        Grid,
        GridItem,
        XInput,
        Group,
        XButton
    },
    mounted() {

    },
    computed: {
        ...mapState({
            companyList: state => state.companyList
        })
    },
    methods: {
        nav(idx) {
            console.log(idx);
            this.$router.push(`/overView/${this.companyList[idx].companyCode}/${this.companyList[idx].holderCode}`)
        }
    }
}
</script>

<style lang="less">
h3 {
    text-align: center;
    font-size: 18px;
    margin: 100px auto 20px;
}

.body {
    height: 100%;
}
</style>